package top.wilbert.collegelink.message.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
import top.wilbert.collegelink.message.dao.ChatListDao;
import top.wilbert.collegelink.message.dao.ChatMessageDao;
import top.wilbert.collegelink.message.entity.ChatListEntity;
import top.wilbert.collegelink.message.entity.ChatMessageEntity;
import top.wilbert.collegelink.message.service.ChatListService;
import top.wilbert.collegelink.message.service.ChatMessageService;

import java.util.List;

/**
 * @Description:
 * @Author:Jiiangyu
 * @CreatTime:2023-02-27-19:49
 */
@Service("ChatMessageService")
public class ChatMessageServiceImpl extends ServiceImpl<ChatMessageDao, ChatMessageEntity> implements ChatMessageService {
    @Override
    public List<ChatMessageEntity> getByLinkId(Long FromLinkId, Long ToLinkId) {

        List<ChatMessageEntity> list = this.baseMapper.selectList(new QueryWrapper<ChatMessageEntity>()
                .in("link_id", FromLinkId, ToLinkId));

        return list;
    }
}
